package com.ykh.mybbsdemo.constant;


import com.ykh.mybbsdemo.util.RSAUtil;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2023-10-27
 * Time: 21:12
 */
public class VideoConstant {

    //视频域名地址
    public static final String VIDEO_URL = "http://sl53pk14u.hn-bkt.clouddn.com/";

    //视频域名地址
    public static final String IMAGE_URL = "http://sl53pk14u.hn-bkt.clouddn.com/";

    //时间格式
    public static  final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";

    //QINIYUN公钥
    public  static  final String ACCESS_KEY = "EQ1pVMA9LvsVrvdqKeiYeuvuwldwWMWYD9ZU2GP2";

    //QINIYUN私钥
    public  static  final String ACCESS_SECRET_KEY = "Iv4nwcw7Q9H194oLJmiRYpl6OiquVQ9h0uTPNnJz";

    //容器桶
    public  static  final String BUCKET = "vedio-container1";

    //RSA公钥
    public static final String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCe7zMfNLHX8wCgYZW6Uzo0XdNDX4FneS0n0i/Tl5db40FeNlA7KTB2xb7AtRfrPb8RSMVutFjW/R4dV/sUzEc+T5Vb0ME/gxql9kUil2dhxzlRuxxXbGKo8kWeh0X5xViiFaaevsmmyyqBWgL9OqMtOSduiDgfCdrLCylxtAvL/wIDAQAB";

    //RSA私钥
    public static final String PRIVATE_KEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJ7vMx80sdfzAKBhlbpTOjRd00NfgWd5LSfSL9OXl1vjQV42UDspMHbFvsC1F+s9vxFIxW60WNb9Hh1X+xTMRz5PlVvQwT+DGqX2RSKXZ2HHOVG7HFdsYqjyRZ6HRfnFWKIVpp6+yabLKoFaAv06oy05J26IOB8J2ssLKXG0C8v/AgMBAAECgYB1qVRJd/NpkgcWtOfqBw+CESwEJsJgXj9lyZ+KoCF372hHXSJMihPM+lxbwjWw/AdlvmAbsvxKPR18T9Qb85eRh8I8h2uYuB1dUEPuf+Sb5knfJs5SPS0bGXfv35vxJ+aYqXeaRZCzSRtfcKqnZSC0bTZyRfDLwVtadSWwijx2cQJBAN4O2WbQsbSlxqQAiQCfZw3l5focFi8QeC9LHyeAICCZSEP8oeycb3d/LeYSh+2u0AfVhopqEUZGOIlC8xDqz6MCQQC3OlEaO9udGciig+xVlIkhB38gEDHQY1vAKn6+S4zHI+p56o0HeT6T3nDXmWsjsVBhy3odIWa5IJO6mYY5nef1AkEAz16qo5ts+Lh/YpSlXJF/2bjCJemoxdbphbDvrSG33vmGRQdd5+rHJZ79LAhOLCa+WzKKbCRVcX0OOxDskPXXZQJASgp7yYEUvsgzhlCPCQor27f+zAMfThlIcz/41YcMDVDbKIb6lGGPQwupR8ZMQDEfzVT/NJRRwU+DwuzVC6VenQJBANZkeT0FY6RN31hW1fg2jdN02Ob9jFxDAyHC5b857G6ojt0bdwiZUAwISD23C0n/HtnZff4focyEIUwm57kPqiI=";

    //视频域名地址
    public static final String DEFAULT_AVATAR_ADDRESS  = "/static/img/user_avatar.png";

    //Redis视频播放Key值
    public static final String VIDEO_PLAY_COUNT_KEY_PREFIX = "video:play_count:";

    //Redis视频播放Key值
    public static final String VIDEO_LIKE_COUNT_KEY_PREFIX = "video:like_count:";

    /**
     * 暂用方法: 获得RSA加密后的超管密码
     */
    public static void getRSA() {
        String stuPasssword =  RSAUtil.encode(
                "654321", VideoConstant.PUBLIC_KEY);
        String stuPasssword1 =  RSAUtil.encode(
                "123456", VideoConstant.PUBLIC_KEY);
        String adminPasssword =  RSAUtil.encode(
                "xiake83420134", VideoConstant.PUBLIC_KEY);
        System.out.println(stuPasssword);
        System.out.println(RSAUtil.decode(stuPasssword, VideoConstant.PRIVATE_KEY));
        System.out.println(stuPasssword1);
        System.out.println(RSAUtil.decode(stuPasssword1, VideoConstant.PRIVATE_KEY));
        System.out.println(adminPasssword);
        System.out.println(RSAUtil.decode(adminPasssword, VideoConstant.PRIVATE_KEY));


    }
    /**
     * 暂用方法: 获得BCypt加密后的密码
     */
    public static void getBcypt(){
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        //使用bcypt进行加密
        String encodePassword = bCryptPasswordEncoder.encode("654321");
        System.out.println(encodePassword);
    }
    public static void main(String[] args) {
        getBcypt();
        getRSA();

    }
}
